package com.jt.controller;

import com.jt.pojo.ItemCat;
import com.jt.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/item/cat")
@RestController
public class ItemCatController {
    @Autowired
    private ItemCatService itemCatService;
    /***
     * 需求：根据itemCatId查询商品分类名称
     *url:
     * 参数：itemCatId=163
     * 返回值：商品分类名称
     *
     */
    @RequestMapping("/queryItemName")
    public String queryItemName(Long itemCatId){

        ItemCat itemCat=itemCatService.queryItemName(itemCatId);
return itemCat.getName();
    }

}
